#ifndef TEXTMODE_H
#define TEXTMODE_H

/*Copyright (c) 2009 Michael Streif
 *
 *Permission is hereby granted, free of charge, to any person obtaining a copy
 *of this software and associated documentation files (the "Software"), to deal
 *in the Software without restriction, including without limitation the rights
 *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *copies of the Software, and to permit persons to whom the Software is
 *furnished to do so, subject to the following conditions:
 *
 *The above copyright notice and this permission notice shall be included in
 *all copies or substantial portions of the Software.
 *
 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *THE SOFTWARE.
 */

#include "types.h"

#define MAX_X			80										// console size x
#define MAX_Y			25										// console size y
#define CONSOLE_SIZE	4000	    							// size of a console window in bytes
#define LINE_SIZE		160										// size of a console line in bytes

void setCell(char c, int8 color, uint8 x, uint8 y);
void clearScreen(int8 color);
char* getLine(uint8 line);
void writeLine(char* string, uint8 line, int8 color);
void clearLine(uint8 line, int8 color);
void getCell(char* c, int8* color, uint8 x, uint8 y);
void setColor(int8 color, uint8 x, uint8 y);
void getColor(int8* color, uint8 x, uint8 y);
void nextEmptyPage();
void scrollDown();
void scrollUp();
bool setupTextmode(int16 pages);
void updateCursor(uint8 x, uint8 y);
void hideCursor();

#endif
